import request from '@/utils/request.js'
// 获取组织架构列表
export function getDepartmentsList() {
  return request({
    url: '/company/department'
  })
}

// 根据ID删除部门
export function delDepartment(id) {
  return request({
    url: '/company/department/' + id,
    method: 'DELETE'
  })
}
// 添加子部门
/**
 * 参数：code，introduce，manager，name，pid
 * @returns
 */
export function addDepartment(data) {
  return request({
    url: '/company/department',
    method: 'POST',
    data
  })
}
// 根据id获取最新部门数据
export function getNewDepartmentDataById(id) {
  return request({
    url: '/company/department/' + id,
    method: 'GET'
  })
}
// 根据id修改部门信息
export function changeDepartmentDataById(data) {
  return request({
    url: '/company/department/' + data.id,
    method: 'PUT',
    data
  })
}
